<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: show_teamstaff.tpl.php 1151 2008-06-24 15:07:32Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 

?>
<div id="joomleague">
<!-- Header with Project Name-->
<?php if ($showPlayer_config['show_project_heading'] == "1" OR $overall_config['show_project_heading'] == "1") { ?>
<div class="componentheading" <?php if ($showPlayer_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") echo 'style="float:left;"';?>><?php echo $htmlHelper->showTitle($joomleague, $overall_config['project_heading_type']); ?></div>
<!-- Druckfunktion -->
<?php if ($showPlayer_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") {
$htmlHelper->PrintIcon( $row, $params, false, '' );
};?>
<!-- Druckfunktion Ende -->
<?php } ?>
<!-- Header END -->

<!-- Bereichsüberschrift z.B Tabelle, Tippabgabe usw. bei Bedarf mit Drucksymbol -->
<table width="100%" class="contentpaneopen">
	<tr>
		<td class="contentheading"><?php echo sprintf ('%s %s' ,$row->firstname,$row->lastname);?></td>
	</tr>
</table>
<!-- Bereichsüberschrift Ende -->
<br />
  
<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
	<tr class="sectiontableheader">
	 <td colspan="2"><?php echo _JL_PLAYER_DATA ;?></td>
	</tr>
<tr><td>&nbsp;</td></tr>
	<tr>
<?php if ($showPlayer_config['show_player_photo']==1) {
$picture = ($row->picture!=''&&!is_null($row->picture)&&file_exists(_JOOMLA_JL_PATH.'/'.$row->picture)) ? $row->picture : $row->default_picture;
if ($picture!=''&&!is_null($picture)&&file_exists(_JOOMLA_JL_PATH.'/'.$picture)) {
?>
      <td width="50%" align="center" valign="middle">
        <?php echo sprintf("<img src=\""._JOOMLA_JL_LIVE_SITE."/%s\" alt=\"%s\" title=\"%s\" />",$picture,$row->lastname,$row->lastname);?>&nbsp;
      </td>
<?php } 
  }?>      
      <td width="50%" align="center" valign="top">
        <table width="100%" border="0">
          <tr>
            <td width="40%"><b><?php echo _JL_PLAYER_NAME;?></b></td>
            <td width="60%" align="left"><?php echo sprintf("%s %s",$row->firstname,$row->lastname); ?>
            <?php
      $thiscountry = new Country($database);
      $thiscountry->load($row->nation);
      echo $thiscountry->getFlag();
     ?>
            
            </td>
          </tr>
<?php if($row->birthday != '0000-00-00'){ ?>
          <tr>
            <td><b><?php echo _JL_PLAYER_BIRTHDAY;?></b></td>
            <td align="left"><?php printf("%s (%s)", mbiFormatDate($row->birthday, _JL_DAYDATE), getAge($row->birthday)); ?></td>
          </tr>
<?php } ?>
<?php if($row->position != ""){ ?>
          <tr>
            <td><b><?php echo _JL_PLAYERS_FUNCTION.':';?></b></td>
            <td align="left"><?php echo $row->position;?></td>
          </tr>
<?php } ?>          

        </table>
      </td>
    </tr>

    </table>
        <br /><br />
        
<!-- Description -->
<?php if ($showPlayer_config['show_player_description']==1 && $row->description !='') {;?>
<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
	<tr class="sectiontableheader">
		<td><?php echo _JL_ADMIN_EDIT_FORM_PLAYERTOOL_TITLE2;?></td>
	</tr>
<tr><td>&nbsp;</td></tr>	
	<tr>
		<td>
			<?php echo $htmlHelper->printContentMambot( $row->description );?>
		</td>
	</tr>
</table>
<br /><br />
<?php };?>
<!-- Description END -->

	<!-- START History as a staff member -->
  <?php 
  if (count($historyStaff) > 0) { ?>
  <table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
  	<tr class="sectiontableheader">
  		<td><?php echo _JL_STAFF_HISTORY;?></td>
  	</tr>
    <tr>
  		<td>
  		  <table width="100%" cellspacing="2" cellpadding="2" border="0">
  		   <tr class="sectiontableheader">
  			    <th><?php echo _JL_PLAYER_PROJECT;?></th>
  			    <th><?php echo _JL_PLAYER_SEASON;?></th>
  			    <th><?php echo _JL_TABLE_TEAM;?></th>
  			    <th><?php echo _JL_PLAYER_POSITION;?></th>
  		  </tr>
        <?php
        foreach ($historyStaff AS $station) {	?>	
  		  <tr>		    
          <?php
          $tts = new TeamStaff ($database);
          $tts->load($station->tsid);
          $pos = new Position($database);
          $pos->load($tts->position_id);
          echo '<td><a href="'.sefRelToAbs(JL_COMPONENT_LINK.'&amp;func=showTeamstaff&amp;p='.$station->project_id.'&amp;pid='.$station->pid
           .'&amp;tsid='.$tts->teamstaff_id.JL_ITEMID_SUFFIX).'">'
           .$station->pname.'</a></td>'   
           .'<td>'.$station->sname.'</td>'
           .'<td><a href="'.sefRelToAbs(JL_COMPONENT_LINK.'&amp;func=showPlayers&amp;p='.$station->project_id.'&amp;ttid='
           .$station->ttid.JL_ITEMID_SUFFIX).'">'.$station->teamname.'</a></td><td>'.$pos->name.'</td>';
              ?>
  			</tr><?php 
        } ?>
  	</table></td></tr></table>
  	<br /><?php 
  }
  ?>
	<!-- END History as a staff member -->
	
	<!--  Start History as a player -->
  <?php 
  if (count($history) > 0) { 
  ?>
  <table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
  	<tr class="sectiontableheader">
  		<td><?php echo _JL_PLAYER_HISTORY;?></td>
  	</tr>
    <tr>
  		<td>
  		  <table width="100%" cellspacing="2" cellpadding="2" border="0">
  		   <tr class="sectiontableheader">
  			    <th><?php echo _JL_PLAYER_PROJECT;?></th>
  			    <th><?php echo _JL_PLAYER_SEASON;?></th>
  			    <th><?php echo _JL_TABLE_TEAM;?></th>
  			    <th><?php echo _JL_PLAYER_POSITION;?></th>
  		  </tr>
  <?php
  foreach ($history AS $station) {	?>
  	
  		  <tr>
  		    
  <?php
      $tpt = new Playertool ($database);
      $tpt->load($station->ptid);
      $pos = new Position($database);
      $pos->load($tpt->position_id);
      echo '<td><a href="'.sefRelToAbs(JL_COMPONENT_LINK
                .'&amp;func=showPlayer&amp;p='.$station->project_id
                .'&amp;pid='.$station->pid
                .JL_ITEMID_SUFFIX).'">'
              .$station->pname
              .'</a>'
            .'</td>'
            .'<td>'.$station->sname.'</td>'
            .'<td>'
              .'<a href="'.sefRelToAbs(JL_COMPONENT_LINK.'&amp;func=showPlayers&amp;p='.$station->project_id.'&amp;ttid='
               .$station->ttid.JL_ITEMID_SUFFIX).'">'
               .$station->teamname
               .'</a>'
            .'</td>'
            .'<td>'.$pos->name.'</td>';
  ?>
  
  	</tr>
  
  <?php } ?>
  	</table></td></tr></table>
  <br /><br />
  <?php 
  } 
  ?>
	<!--  END History as a player -->
	
<!-- Print Button START -->
<?php if ($showPlayer_config['show_back_button'] > 0 OR $overall_config['show_back_button'] > 0) {;?>
<?php if ($showPlayer_config['show_back_button'] == "1" OR $overall_config['show_back_button'] == "1") echo '<div align="left">'; else echo '<div align="right">';?>
<?php
$params = & new mosParameters( '' );
$params->def( 'back_button', true );
$params->def( 'popup', false );
mosHTML::BackButton( $params );
  echo "</div>";
};?>
<!-- Print Button END -->  
</div>
